﻿@model UserInfoEditModel
<script type="text/javascript">
    $(document).ready(function () {
        $('#btnSubmit').click(function () {
            $('#UserDetailForm').submit();
        });
        $('#resetForm').click(function () {
            $('#UserDetailForm')[0].reset();
        });
    });
</script>
<div class="box">
    <!-- Box Head -->
    <div class="box-head">
        <h2>
            用户基本信息</h2>
    </div>
    <!-- End Box Head -->
    <div class="table">
        @if (Model.UserName == null || Model.ID == null)
        {
            <div class="empty">
                没有记录</div>
        }
        else
        {
            using (Html.BeginForm("UserDetail", "User", FormMethod.Post, new { ID = "UserDetailForm" }))
            {
            @Html.ValidationSummary(true)
            <!-- Form -->
            <table class="tableForForm">
                <tr>
                    <td align="right">
                        用户名：
                    </td>
                    <td>@Html.HiddenFor(model => model.ID)
                        @Html.TextBoxFor(model => model.UserName, new { @class = "field size7" })
                        <span class="tip">*</span>
                    </td>
                    <td>@Html.ValidationMessageFor(model => model.UserName)</td>
                    <td align="right">
                        用户姓名：
                    </td>
                    <td>
                        @Html.TextBoxFor(model => model.FamilyName, new { @class = "field size7" })
                        <span class="tip">*</span>
                    </td>
                    <td>
                        @Html.ValidationMessageFor(model => model.FamilyName)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        密码：
                    </td>
                    <td>
                        @Html.PasswordFor(model => model.Password, new { @class = "field size7" })
                    </td>
                    <td>@Html.ValidationMessageFor(model => model.Password)</td>
                    <td align="right">
                        重复密码：
                    </td>
                    <td>
                        @Html.PasswordFor(model => model.ConfirmPassword, new { @class = "field size7" })
                       
                    </td>
                    <td>
                         @Html.ValidationMessageFor(model => model.ConfirmPassword)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        用户组：
                    </td>
                    <td colspan="1">
                        @Html.DropDownList("RoleIDs", null, new { @class = "field size7" })
                    </td>
                    <td></td>
                    <td align="right">
                        Email：
                    </td>
                    <td>
                        @Html.TextBoxFor(model => model.Email, new { @class = "field size7" })
                        <span class="tip">*</span>
                    </td>
                    <td>
                        @Html.ValidationMessageFor(model => model.Email)
                    </td>
                </tr>
            </table>
            }
        }
    </div>
    <div class="buttons">
        <a href="#" class="cancel-button" id="resetForm"><span>清空</span></a> <a href="#"
            class="submit-button" id="btnSubmit" style="margin-left: 10px;"><span>保存</span></a>
    </div>
</div>
<!-- End Box -->
<!-- End Content -->
@section SideBar  {
    <div class="box">
        <!-- Box Head -->
        <div class="box-head">
            <h2>
                用户权限管理</h2>
        </div>
        <!-- End Box Head-->
        <div class="box-content">
            <a href="@Url.Action("UserRoleList", "User")" class="add-button"><span>用户组管理</span></a>
            <div class="cl">
                &nbsp;</div>
            <a href="@Url.Action("Index", "User")" class="add-button"><span>用户列表</span></a>
            <div class="cl">
                &nbsp;</div>
        </div>
    </div>
    <!-- End Box -->
}
